home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / AIAT 1.0.1 / Headers / Accessor / InVecAccessor.h < prev    next >
Encoding:
Text File  |  1997-09-11  |  2.0 KB  |  78 lines  |  [TEXT/CWIE]

  1. // InVecAccessor.h
  2. // accellerates searches on InVec indices
  3. //    Copyright:    © 1994 - 1996-1997 by Apple Computer, Inc., all rights reserved.
  4.  
  5. #pragma once
  6. #ifndef InVecAccessor_h
  7. #define InVecAccessor_h
  8.  
  9. #pragma import on
  10.  
  11. #include "VectorAccessor.h"
  12. #include "InvertedAccessor.h"
  13. #include "InVecIndex.h"
  14.  
  15. #pragma IA_BEGIN_EXPORTS
  16.  
  17. class IAQuery;
  18.  
  19. const uint32 InVecAccessorType = 'I&V0';
  20.  
  21. class InVecAccessor : public InvertedAccessor,  public VectorAccessor {
  22. public:
  23.         InVecAccessor(InVecIndex** indices, uint32 indexCount, uint32 type = InVecAccessorType);
  24.         ~InVecAccessor();
  25.         
  26.     uint32        RankedSearch(byte*                     textQuery,     uint32     textQueryLen,
  27.                              RankedQueryDoc*         docQuery,     uint32     docQueryLen,
  28.                              RankedHit**            results,    uint32    resultLen,
  29.                              uint32                    matchingTermsLen,
  30.                              RankedProgressFn*        progressFn,
  31.                              clock_t                progressFreq,
  32.                              void*                    appData);
  33.                              
  34.     uint32        RankedSearch(IADocText*             textQuery,
  35.                              RankedQueryDoc*         docQuery,     uint32     docQueryLen,
  36.                              RankedHit**            results,    uint32    resultLen,
  37.                              uint32                    matchingTermsLen,
  38.                              RankedProgressFn*        progressFn,
  39.                              clock_t                progressFreq,
  40.                              void*                    appData);
  41.  
  42. protected:
  43.     void        Initializing();
  44.     void        CacheTermStats(TermInfo** infos);
  45.  
  46.     IABlockSize    InitsSize();
  47.     void        StoringInits(IAOutputBlock* output);
  48.     void        RestoringInits(IAInputBlock* input);
  49.     void        TrimQueryVector(TWVector* queryVector, byte* maxWeights);
  50.     byte**         GetTermMaxWeights() const;
  51.     float*        GetMaxWeightDecoder() const;
  52.     float        GetMaxWeightEncodingFactor() const;
  53.  
  54. private:
  55.     byte**        termMaxWeights;
  56.     float*        maxWeightDecoder;
  57.     float        maxWeightEncodingFactor;
  58.     
  59.     void        MakeMaxWeightCodec();
  60. };
  61.  
  62. inline     byte**     InVecAccessor::GetTermMaxWeights() const
  63. {
  64.     return termMaxWeights;
  65. }
  66. inline     float*    InVecAccessor::GetMaxWeightDecoder() const
  67. {
  68.     return maxWeightDecoder;
  69. }
  70. inline    float    InVecAccessor::GetMaxWeightEncodingFactor() const
  71. {
  72.     return maxWeightEncodingFactor;
  73. }
  74.  
  75. #pragma IA_END_EXPORTS
  76.  
  77. #pragma import reset
  78. #endif